/*
 * 人人信用管理有限公司版权所有.
 * 
 * @Description:
 * 
 * @author: liyuliang
 * 
 * @date: 20 Apr 2017 10:44:16 am
 * 
 * 注意：本内容仅限于人人信用管理有限公司内部传阅，禁止外泄以及用于其他的商业目的.
 */

package com.rrx360.common.web.filter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;

import org.springframework.orm.hibernate5.support.OpenSessionInViewFilter;

import com.rrx360.common.web.matcher.ServletPathMatcher;

public class OpenSessionInViewFilterExt extends OpenSessionInViewFilter {

  private ServletPathMatcher pathMatcher;



  public ServletPathMatcher getPathMatcher() {
    return pathMatcher;
  }



  public void setPathMatcher(ServletPathMatcher pathMatcher) {
    this.pathMatcher = pathMatcher;
  }



  protected boolean shouldNotFilter(HttpServletRequest request) throws ServletException {
    if (pathMatcher != null) {
      return !pathMatcher.match(request);
    }
    return super.shouldNotFilter(request);
  }
}
